enum EDialogResult;
class CBaseConnection;

namespace AVUI
{
    class Object;
    class RoutedEventArgs;
    class UIElement;
    class ListView;
    class SelectionChangedEventArgs;
}

class CGameStateGetServerName : public CBaseGameState
{
public:
    CGameStateGetServerName() : m_pBaseConnection(NULL) { }

    void Initialize(CNetrekClientListener* pListener);
    void Cleanup();
    void FrameStart();

private:
    void ErrorDialogOK(EDialogResult) { }

    void ConnectButtonClicked(AVUI::Object* pObject, AVUI::RoutedEventArgs* pEventArgs);

    void ListClicked(AVUI::Object* pSender, AVUI::MouseButtonEventArgs* pEventArgs);
    void ListSelectionChanged(AVUI::Object* pSender, AVUI::SelectionChangedEventArgs* pEventArgs);

    void ProcessMetaserverData(const char* pbData, int cbData);

    CBaseConnection* m_pBaseConnection;
    AVUI::ListView* m_pList;
    AVUI::FrameworkElement* m_pRoot;

    static const char* cs_szMetaserver;
    static const WORD cs_wMetaserverPort = 3521;

};


